package com.ozy.kxreader.base

import android.app.Application
import com.google.gson.Gson
import com.ozy.kxreader.di.component.AppComponent
import com.ozy.kxreader.di.component.DaggerAppComponent
import com.ozy.kxreader.di.module.AppModule


/**
 * Created by 欧源 on 2018/1/29.
 */
class BaseApplication : Application() {


    init {
        instance = this
    }

    lateinit var appComponent: AppComponent

    lateinit var gson: Gson;

    override fun onCreate() {
        super.onCreate()
        appComponent = DaggerAppComponent
                .builder()
                .appModule(AppModule(this))
                .build()
        appComponent.inject(this);
    }


    companion object {
        lateinit var instance: BaseApplication
    }
}